package com.genersoft.iot.vmp.storager.dao;

import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.storager.dao.dto.YDeviceUpgradeConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用于存储设备信息
 */
@Mapper
@Repository
public interface YDeviceUpgradeConfigMapper {

    @Select(   value = {" <script>" +
            " SELECT id,manufacturer,model,title,version,upgrade_package as upgradePackage,status,remarks,create_time,update_time FROM y_device_upgrade_config WHERE status = 1  " +
            " <if test=\"manufacturer != null\" >  AND manufacturer = '${manufacturer}'</if>" +
            " <if test=\"model != null\" >  AND model = '${model}' </if>" +
            " <if test=\"version != null\" >  AND version = '${version}' </if>" +
            " ORDER BY create_time DESC " +
            " </script>"})
    List<YDeviceUpgradeConfig> getUpgradeConfig(String manufacturer,String model,String version);

}
